package com.bing.bingPro.controller.topoly;

import cn.hutool.core.text.CharSequenceUtil;
import com.bing.bingPro.common.BaseResult;
import com.bing.bingPro.controller.dto.TTopologyDto;
import com.bing.bingPro.controller.vo.TNetworkTopologyUserVo;
import com.bing.bingPro.service.TNetworkTopologyUserService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 大网拓扑
 */
@RestController
public class TTopologyController {

    @Resource
    private TNetworkTopologyUserService tNetworkTopologyUserService;


    /**
     * 查询账号基础信息
     *
     * @param tTopologyDto
     * @return
     */
    @PostMapping("/userList")
    public BaseResult<TNetworkTopologyUserVo> userList(@RequestBody TTopologyDto tTopologyDto) {
        if (CharSequenceUtil.isEmpty(tTopologyDto.getUserId())) {
            return new BaseResult<>(404, "参数有误，userId为必填项！");
        }
        return new BaseResult<>(this.tNetworkTopologyUserService.getByUser(tTopologyDto));
    }
}
